package com.api.shopapi.service.impl;

import com.api.shopapi.entity.CallRecord;
import com.api.shopapi.mapper.CallRecordMapper;
import com.api.shopapi.service.CallRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

//import javax.xml.soap.SAAJResult;
import java.util.List;

@Service("CallRecordServiceImplOne")
public class CallRecordServiceImpl  implements CallRecordService {
    @Autowired
    private CallRecordMapper callRecordMapper;

    @Override
    public int insert(CallRecord callRecord) {
        return callRecordMapper.insert(callRecord);
    }

    @Override
    public int update(CallRecord callRecord) {
        return callRecordMapper.update(callRecord);
    }

    @Override
    public CallRecord getByCallRecordCode(String callRecordCode) {
        return callRecordMapper.getByCallRecordCode(callRecordCode);
    }

    @Override
    public List<CallRecord> getList() {
        return callRecordMapper.getList();
    }

    @Override
    public PageInfo<CallRecord> getSeatsList(int pageNum, int pageSize, String phone) {
        PageHelper.startPage(pageNum, pageSize);
        List<CallRecord> listSeats = callRecordMapper.getSeatsList(phone);
        PageInfo<CallRecord> pageInfo = new PageInfo<CallRecord>(listSeats);
        return pageInfo;
    }

    @Override
    public List<CallRecord> getListByUserCode(String userCode) {
        return callRecordMapper.getListByUserCode(userCode);
    }
}
